<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>数组实例的 entries()，keys() 和 values()</title>
</head>

<body>

    <script>
        for (let index of ['a', 'b'].keys()) {
            console.log(index);
        }
        // 0
        // 1
        for (let elem of ['a', 'b'].values()) {
            console.log(elem);
        }
        // 'a'
        // 'b'
        for (let [index, elem] of ['a', 'b'].entries()) {
            console.log(index, elem);
        }
        // 0 "a"
        // 1 "b"
    </script>
</body>

</html>